<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/js/plugins/echarts/echarts.common.min.js"></script>

</head>

<body>
<div id="main" style="width: 1600px;height:800px;"></div>

<script>

    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        legend: {},
        tooltip: {},
        dataset: {
            source: [
                ['product','总消费金额', '总实收金额', '总优惠金额'],
               <#list items as i>
                ['${i.groupByName}', ${i.totlaAmount}, ${i.PayAmount}, ${i.DiscountAmount}]
                // 判断需不需要加,
                <#if i_index < (items?size-1)>
                    ,
                </#if>
               </#list>
            ]
        },
        xAxis: {type: 'category'},
        yAxis: {},
        // Declare several bar series, each will be mapped
        // to a column of dataset.source by default.
        series: [
            {type: 'bar'},
            {type: 'bar'},
            {type: 'bar'}
        ]
    };

    option && myChart.setOption(option);


</script>

</body>
</html>